package br.com.gp.controller.cadastro;

import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import br.com.gp.entidade.Menu;
import br.com.gp.excecoes.ExceptionApplication;
import br.com.gp.excecoes.ExceptionValidador;
import br.com.gp.gerentes.GerenteCadastro;
@ManagedBean(name="cadastroMenu")
@SessionScoped
public class CadastroMenuController extends CadastroPadraoController implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -356413786274619902L;
	
	private Menu menu;

	@Override
	public void acaoInserir() {
		// TODO Auto-generated method stub
		GerenteCadastro gc = getAtendente().chamaGerenteCadastro();
		try {
			gc.incluir(getMenu());
		} catch (ExceptionApplication e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ExceptionValidador e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@Override
	public void acaoAlterar() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void acaoDeletar() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void acaoLimpar() {
		// TODO Auto-generated method stub
		
	}

	public Menu getMenu() {
		if(menu==null){
			menu = new Menu();
		}
		return menu;
	}

	public void setMenu(Menu menu) {
		this.menu = menu;
	}

}
